/**
 * Created by wangshuyi on 2017/2/4.
 */

'use strict';

var productListPage = {
    init: null,
    initElement: null,
    initEvent: null,
    buildPosCode:$('#buildPosCode'),
    headImg: $('#userImg')
};

productListPage.init = function () {
    this.initElement();
    this.initEvent();
};

productListPage.initElement = function () {
    var thisPage = this;
    thisPage.headImg.attr('src',contextData.userData.headimgurl||"/custom/images/icon/defaul.png")
};
productListPage.initEvent = function () {
    var thisPage = this;
    $('#getCard').click(function () {
        $('#getCard').html('  <span class="weui-loading" ></span>');
        Dolphin.ajax({
            url:contextData.contextPath + '/work/buildPosCode?cardCode=' + contextData.userData.cardCode,
            type : 'get',
            onSuccess:function (data) {
                $('#getCard').html(data.posCode)
            },
            onError:function (e) {
            }
        })
    })
};

$(function () {
    productListPage.init();
});